package com.uikoo9.job;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.uikoo9.manage.y.model.YIdeaModel;
import com.uikoo9.manage.y.util.TimeUtil;
import com.uikoo9.util.core.http.QHttpClientUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 重复每日，每周定时需要新增的任务等。
 */
public class visitUrlJob implements Job {
    static int callTime = 0;

    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {
        String url = arg0.getJobDetail().getDescription();
        String result = QHttpClientUtil.get(url);
        print("result:"+result);
        callTime++;
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " visitUrlJob works,callTime is: " + callTime);
    }

    void print(String msg) {
        System.out.println(msg);
    }

}
